home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / netzwerk / tcp-ip / ipdial_v1.9 / login.ipdial < prev    next >
Text File  |  1996-02-26  |  4KB  |  157 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;
  3. ;   Login script for AmiTCP/SLIP connection to the University of
  4. ;   Tuebingen, Germany using IPDial
  5. ;
  6. ;   Version 1.1,    06.12.1994
  7. ;
  8. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  9. ;
  10. ;   The line below *must* be present and *must* be the first command
  11. ;   line in the script. It specifies the device and the protocol to
  12. ;   use. (Possible protocols are 7WIRE (= RTSCTS), XONXOFF or NONE.)
  13. ;   You may omit the protocol, in which case the defaults of the
  14. ;   serial.device are used.
  15. ;
  16. ;   Be sure, that the parameters you are using in this script are the
  17. ;   same as used for initializing AmiTCP/IP!
  18.  
  19.     DEVICE serial.device 7WIRE UNIT 0
  20.  
  21.  
  22. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  23. ;
  24. ;   Certain settings (Note, that these override the respective settings
  25. ;   of the serial.prefs.)
  26. ;
  27. ;   Possible settings are:
  28. ;       BAUD            Baudrate, integer
  29. ;       DATABITS        number of data bits, integer
  30. ;       STOPBITS        number of stop bits, integer
  31. ;       BUFSIZE         Read buffer size, integer
  32. ;       PARITY          one of NONE, ODD or EVEN
  33. ;
  34. ;   These are scanned with ReadArgs(), thus you can either use the syntax
  35. ;       set BAUD=38400
  36. ;   or, if you prefer, this version
  37. ;       set BAUD 38400
  38. ;   In the first case, however, it is important, that you omit blanks.
  39. ;
  40.  
  41.     set BAUD=38400 DATABITS=8 STOPBITS=1 BUFSIZE=4096
  42.  
  43. ;   Possible settings in the following line are:
  44. ;       NONE EVEN ODD
  45.  
  46.     set PARITY=NONE
  47.  
  48.  
  49. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  50. ;
  51. ;   Show the new settings
  52.  
  53. ;   SHOWPARMS
  54.  
  55.  
  56. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  57. ;
  58. ;   Send initialization command
  59.  
  60.     SEND "ATZ\r"
  61.  
  62.  
  63. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  64. ;
  65. ;   Wait for the modems ok; break, if timeout
  66.     WAIT TIMEOUT=10 "NO CARRIER" "OK"
  67.     ON STATUS GOTO TIMEOUT NoCarrier
  68.  
  69.  
  70. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  71. ;
  72. ;   Initialize the modem not to hang up, when IPDial terminates (this
  73. ;   will make DTR becoming low)
  74.  
  75.     SEND "AT&D0\r"
  76.  
  77.  
  78. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  79. ;
  80. ;   Wait for the modems ok; break, if timeout
  81.  
  82.     WAIT TIMEOUT=10 "OK"
  83.     ON STATUS GOTO TIMEOUT
  84.  
  85.  
  86. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  87. ;
  88. ;   Dialing ...
  89.  
  90. Dial:
  91.     SEND "ATDP07071927920\r"
  92.  
  93.     WAIT TIMEOUT=60 "Username: " "BUSY" "DELAYED"
  94.     ON STATUS GOTO TIMEOUT Login
  95.  
  96.  
  97. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  98. ;
  99. ;   The usual case: Our Remote is busy. :-(
  100. ;   We do a delay of 30 secs (thanks, telecom :-) and dial again.
  101.  
  102.     Echo "Remote busy, delaying ...\n"
  103.     DELAY 30
  104.     Echo "Trying again.\n"
  105.     GOTO Dial
  106.  
  107.  
  108. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  109. ;
  110. ;   Okay, we are connected. Login into the host. It is a local
  111. ;   convention that we have to enter the password twice.
  112.  
  113. Login:
  114.     SEND "zrawi01\r"
  115.     WAIT TIMEOUT=60 "Password: "
  116.     ON STATUS GOTO TIMEOUT
  117.     SEND "<mypassword>\r"
  118.     WAIT TIMEOUT=60 "TS2>"
  119.     ON STATUS GOTO TIMEOUT
  120.     SEND "slip zrawi01\r"
  121.     WAIT TIMEOUT=60 "Password:"
  122.     ON STATUS GOTO TIMEOUT
  123.     SEND "<mypassword>\n"
  124.     WAIT TIMEOUT=60 "bytes"
  125.  
  126. ;   If we came so far, everything is fine. AmiTCP (and thus Slip) may be
  127. ;   started.
  128. ;
  129. ;   Remote host will answer with a string like
  130. ;
  131. ;       Your IP address is 134.2.1.23, MTU 1524 bytes.
  132. ;
  133. ;   Scan this and store the values into the environment variables
  134. ;   IPADDRESS and MTU, so that they can be used by the startnet script.
  135.  
  136.     SCAN "%{Your IP address is%} %[IPADDRESS%]%(,%) %{MTU%} %[MTU%]" GLOBAL
  137.  
  138.     ECHO "Slip connection ready, starting AmiTCP/IP.\n"
  139.     EXIT 0
  140.  
  141.  
  142. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  143. ;
  144. ;   Error message: Timeout
  145.  
  146. TIMEOUT:
  147.     ECHO "\nTimeout\n"
  148.     EXIT 10
  149.  
  150. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  151. ;
  152. ;   Error message: NO CARRIER
  153.  
  154. NoCarrier:
  155.     ECHO "\nNO CARRIER\n"
  156.     EXIT 10
  157.